import argparse
import os

import yaml

def get_config():
    parser = argparse.ArgumentParser()
    parser.add_argument('--config', type=str, default='../config.yaml', help='input config yaml file')
    params = parser.parse_args()

    if os.path.exists(params.config):
        config = yaml.load(open(params.config, 'r'), Loader=yaml.FullLoader)
    else:
        raise FileNotFoundError("Please check your config yaml file")
    return config